package com.zxc.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.zxc.dao.CstLostMapper;
import com.zxc.dao.CstactityMapper;
import com.zxc.entity.Cstactity;
import com.zxc.service.CstactityService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

@Service
public class CstactityServiceImpl extends ServiceImpl<CstactityMapper, Cstactity> implements CstactityService {

    @Autowired
    private CstactityMapper cstactityMapper;

    @Autowired
    private CstLostMapper cstLostMapper;

    @Override
    public List<Map<String, Object>> getCstactityList(int skipCounts, Integer pageSize, String searchName) {
        return cstactityMapper.selectLostCustomer(skipCounts,pageSize,searchName);
    }

    @Override
    public int selectCountCstactityForCustomer() {
        return  cstLostMapper.selectCount(new QueryWrapper<>());
    }

    @Override
    public List<Map<String, Object>> selectCstactityByAtvId(Integer atvId) {
        return cstactityMapper.selectCstactityByAtvId(atvId);
    }
}
